<template>
  <view :data-theme="cueTheme">
    <custom-navbar title="统计" />
    <basic-components />
    <view class="search">
      <view class="date">
        <uni-datetime-picker v-model="dateScope" type="daterange" @change="init(selectIndex)" />
      </view>
      <view class="select-btn">
        <view :class="[selectIndex === 0 ? 'active-btn' : '']" @tap="init(0)">
          图表1
        </view>
        <view :class="[selectIndex === 1 ? 'active-btn' : '']" @tap="init(1)">
          图表2
        </view>
      </view>
    </view>
    <dom-echart :module-param="moduleParam" :option-data="useOptions" />
  </view>
</template>
<script>
import { getFiles } from "@/utils/getFiles";
import dayjs from "dayjs";
const files = require.context("./mixins", false, /js$/);
const mixins = getFiles(files);
import domEchart from "@/components/echarts/echarts.vue";
export default {
  components: {
    domEchart
  },
  mixins: [...mixins],
  onShow() {
  },
  onLoad(option) {
    this.$nextTick(() => {
      this.init(0)
    })
  },
  data() {
    return {
      dateScope: [dayjs().subtract(7, "day").format("YYYY-MM-DD"), dayjs().format("YYYY-MM-DD")]
    }
  },

}
</script>
<style lang='scss' scoped src="./index.scss"></style>
